package com.oig.base.api;

import com.oig.base.api.factory.ParamFallBackFactory;
import com.oig.sys.base.vo.ParamVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

@FeignClient(contextId="paramService", value="sys-base-server", path="/param", fallbackFactory=ParamFallBackFactory.class)
public interface ParamService {

    /**
     * 根据代码获取系统参数
     * @param code 参数代码
     */
    @GetMapping(value = "/getParam/{code}")
    ParamVo getParam(@PathVariable("code") String code);

    /**
     * 根据系统参数代码获取 id序号，每日刷新
     * @param code 系统参数代码
     */
    @GetMapping(value = "/getNextId/{code}")
    Integer getNextId(@PathVariable("code") String code);

    /**
     * 重置所有 id生成器的序号
     */
    @PostMapping(value = "/reset")
    void resetAllIdIndex();

}
